package cn.xfdzx.android.apps.shop.adapter;


import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @author gzk
 * @date 2020/3/31 0031
 * description：
 */
public class HomeVPAdapter extends FragmentPagerAdapter {
    private FragmentManager manager;
    private String[] title;
    private List<Fragment> list;

    public HomeVPAdapter(FragmentManager fm, String[] title, List<Fragment> list) {
        super(fm);
        this.manager = fm;
        this.title = title;
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
